n = 10001
for num in range(1,n):#1到10000
    sum = 0
    for i in range(1,num):#找因子
        if num % i == 0:
            sum += i
    if sum == num:
        print(sum,end = ' ')








